package com.sneaker.shower.mapstruct;

import com.sneaker.shower.entity.domain.message.MessageDO;
import com.sneaker.shower.entity.dto.MessageDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper(componentModel = "spring")
public interface MessageMapStruct {
    MessageMapStruct INSTANCE = Mappers.getMapper(MessageMapStruct.class);

    @Mapping(target = "sessionGuid", ignore = true)
    MessageDTO do2DTO(MessageDO messageDO);

    @Mapping(target = "sessionGuid", ignore = true)
    MessageDO dto2DO(MessageDTO messageDTO);

    List<MessageDTO> doList2DTOList(List<MessageDO> doList);
}
